package com.max.eshop.comporators;

import java.util.Comparator;
import com.max.eshop.core.Order;

public class SortedOrdersByDate implements Comparator<Order> {

	@Override
	public int compare(Order arg0, Order arg1) {
		if (arg0.getDate().after(arg1.getDate())) {
			return 1;
		} else if (arg0.getDate().before(arg1.getDate())) {
			return -1;
		} else {
			return 0;
		}
	}
}